# Maintainer: wahibre <wahibre@gmx.com>

_realname=mtn
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=3.4.2
pkgrel=3
pkgdesc="Command line program to save thumbnails (screenshots) of movie or video files into jpeg/png files (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
url="https://gitlab.com/movie_thumbnailer/mtn"
license=('GPL2')
source=("${url}/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.gz")
sha256sums=('19b2076c00f5b0ad70c2467189b17f335c6e7ece5d1a01ed8910779f6a5ca52a')
makedepends=("${MINGW_PACKAGE_PREFIX}-make"
             "${MINGW_PACKAGE_PREFIX}-cc")
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
         "${MINGW_PACKAGE_PREFIX}-libgd")

build() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mingw32-make
}

package() {
  cd "${srcdir}/${_realname}-v${pkgver}/src"
  mkdir -p ${pkgdir}/${MINGW_PREFIX}/bin/
  install -m 755 ../bin/mtn ${pkgdir}/${MINGW_PREFIX}/bin/
  mkdir -p ${pkgdir}/${MINGW_PREFIX}/share/man/man1
  cp -p ../man/mtn.1 ${pkgdir}/${MINGW_PREFIX}/share/man/man1/
}
